    <h2 id="动态增减功能"> 动态增减功能</h2>
    <p>很多时候，插件中会提供一些功能供用户进行个性化设置（例如：<code>网页快开</code>插件），这部分配置无法在<code>plugin.json</code>事先定义好，所以我们提供了以下方法对插件功能进行动态增减。
    </p>
    <h3 id="getFeatures"> getFeatures</h3>
    <ul>
        <li><code>返回</code> Array</li>
    </ul>
    <p>返回本插件所有动态增加的功能。</p>
    <div class="language-js extra-class">
        <pre class="language-js"><code><span class="token keyword">const</span> features <span class="token operator">=</span> utools<span class="token punctuation">.</span><span class="token function">getFeatures</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>features<span class="token punctuation">)</span>
  </code></pre>
    </div>
    <h3 id="setFeature"> setFeature</h3>
    <ul>
        <li><code>返回</code> Boolean</li>
    </ul>
    <p>为本插件动态新增某个功能。</p>
    <div class="language-js extra-class">
        <pre class="language-js"><code><span class="token keyword">const</span> featureConf <span class="token operator">=</span> <span class="token punctuation">{</span>
      <span class="token string">"code"</span><span class="token punctuation">:</span> <span class="token string">"hosts"</span><span class="token punctuation">,</span>
      <span class="token string">"explain"</span><span class="token punctuation">:</span> <span class="token string">"hosts切换"</span><span class="token punctuation">,</span>
      <span class="token string">"cmds"</span><span class="token punctuation">:</span><span class="token punctuation">[</span><span class="token string">"hosts"</span><span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
  utools<span class="token punctuation">.</span><span class="token function">setFeature</span><span class="token punctuation">(</span>featureConf<span class="token punctuation">)</span>
  </code></pre>
    </div>
    <blockquote>
        <p>featrureConf 格式与<code>plugin.json</code>中配置的格式一致</p>
    </blockquote>
    <h3 id="removeFeature"> removeFeature</h3>
    <ul>
        <li><code>返回</code> Boolean</li>
    </ul>
    <p>动态删除本插件的某个功能。</p>
    <div class="language-js extra-class">
        <pre class="language-js"><code>utools<span class="token punctuation">.</span><span class="token function">removeFeature</span><span class="token punctuation">(</span>featureCode<span class="token punctuation">)</span>
  </code></pre>
    </div>